package de.tu_darmstadt.gdi1.xcom.tests.adapters;

import java.util.List;

import de.tu_darmstadt.gdi1.framework.utils.Point;
import de.tu_darmstadt.gdi1.xcom.model.elements.Door;
import de.tu_darmstadt.gdi1.xcom.model.elements.GameElement;

/**
 * This is the testadapter for testcases for the third level of completion.
 * Implement the empty methods in this adapter and match them to your
 * concrete implementation of the game.
 * 
 * Note: This adapter extends the level2-testadapter
 * 
 * @author Lukas Schwoebel
 * @author Waldemar Ankudin
 * @author Michael Zinn
 *
 */

public class XcomTestAdapterLevel3 extends XcomTestAdapterLevel2 {
	
	/**
	 * return if the door at the given coordinate is open or still locked
	 */
	public boolean isDoorOpen(int x, int y) {
		// TODO: fill stub
		List<GameElement> fieldElements = testImpl.getGameElementsOnField(new Point(x, y));
		return !((Door)fieldElements.get(0)).isLocked();
	}

	/**
	 * return if a field is visible in fog of war.
	 * there are two levels of "visibility", but both are using this method.
	 * If you implemented the second level (in implementationlevel 4), tests for
	 * the first visibility-level won't fail.
	 */
	public boolean isFieldVisible(int x, int y) {
		// TODO: fill stub
		return testImpl.getVisibilityForField(new Point(x, y));
	}
}
